#pragma once

#include "InputDevice.h"


class CKeyMapping;

class CKeyboard: public IKeyboard, public CInputDevice
{
public:
	CKeyboard();
	~CKeyboard();

	//	IKeyboard
	virtual bool IsKeyPressed(EKey key) const;
	//	---

	void ProcessMessage(const RAWKEYBOARD& msg);

private:
	USHORT GetVirtualKey(const RAWKEYBOARD& msg) const;
	void RegisterInputDevice();
	char MessageToCharacter(const RAWKEYBOARD& msg);
	void SetKeyState(EKey key, EKeyState key_state);

private:
	static const char MAX_LATIN_CHARACTER = 127;

	bool	m_keys[eKey_Count];
	std::unique_ptr<CKeyMapping>	m_keymap;
};